﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ket_noi_toi_VPP_bang_mo_hinh_ba_lop.VO;
using System.Data;

namespace Ket_noi_toi_VPP_bang_mo_hinh_ba_lop.VO
{
    class UserVOChiTietHDBan
    {
        private string _MaHDBan;
        private string _MaSP;
        private int _SoLuong;

        public UserVOChiTietHDBan(string MaHDBan, string MaSP, int SoLuong)
        {
            this._MaHDBan = MaHDBan;
            this._MaSP = MaSP;
            this._SoLuong = SoLuong;
        }

        public string MAHOADONBAN
        {
            get { return _MaHDBan; }
            set { _MaHDBan = value; }
        }

        public string MASANPHAM
        {
            get { return _MaSP; }
            set { _MaSP = value; }
        }

        public int SOLUONG
        {
            get { return _SoLuong; }
            set { _SoLuong = value; }
        }

        public void CreateFormCTHD(DataRow dr)
        {
            if (dr != null)
            {
                this._MaHDBan = dr.IsNull(0) ? string.Empty: Convert.ToString(dr[0]);
                this._MaSP = dr.IsNull(1) ? string.Empty : Convert.ToString(dr[1]);
                this._SoLuong = dr.IsNull(2) ? 0: Convert.ToInt32(dr[2]);
            }
        }
    }
}
